interface ISleep{ //好像只能是abstract修饰
    void sleep();
}
interface ISwimming{
    void swimming();//public abstract
}
interface IFlying{
    void flying();
}
class Animal{
    public String name;
    public int age;

    public Animal(String name) {
        this.name = name;
    }

    public void eat(){
        System.out.println(name + "正在吃饭！");
    }
}
class Dog extends Animal implements ISleep{
    public Dog(String name) {
        super(name);
    }

    @Override
    public void sleep() {
        System.out.println(name + "正在睡觉！");
    }
}

class Bird extends Animal implements IFlying,ISleep{
    public Bird(String name) {
        super(name);
    }
    @Override
    public void flying() {
        System.out.println(name+"正在fly!");
    }

    @Override
    public void sleep() {
        System.out.println(name+"正在睡觉！");
    }
}

public class Test1 {
    public static void fly(IFlying flying){
        flying.flying();
    }
    public static void sleep(ISleep sleep){
        sleep.sleep();
    }
    public static void main(String[] args) {
        fly(new Bird("lisa"));
        sleep(new Dog("1"));
        sleep(new Bird("2"));

        System.out.println();
    }
}
